package com.yy.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yy.entity.Bed;
import com.yy.service.BedService;
import com.yy.mapper.BedMapper;
import org.springframework.stereotype.Service;

/**
* @author 雨
* @description 针对表【bed】的数据库操作Service实现
* @createDate 2024-06-07 11:42:25
*/
@Service
public class BedServiceImpl extends ServiceImpl<BedMapper, Bed>
    implements BedService{

    @Override
    public boolean updateStatebed(int id) {
        return this.update(new LambdaUpdateWrapper<Bed>()
                .eq(Bed::getBedid, id)
                .set(Bed::getState, 1)
        );
    }

    @Override
    public boolean updateregisterbed(int id) {
        return this.update(new LambdaUpdateWrapper<Bed>()
                .eq(Bed::getBedid, id)
                .set(Bed::getState, 0)
        );
    }
}




